package com.example.demo.mapper;

import com.example.demo.entity.Compression;
import com.example.demo.entity.Goods;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @Description
 * @Author chenhuiyu
 * @Date 2023/12/18
 */
@Mapper
@Repository
public interface CompressionMapper {
    @Insert("INSERT INTO compression (id,compress_data ,data,create_time) " +
            "VALUES (#{compression.id},#{compression.compressData},#{compression.data},#{compression.createTime})")
    Long insertCompression(@Param("compression") Compression compression);

    @Select("SELECT id,compress_data,data,create_time FROM compression WHERE id = #{id}")
    @Results(id = "Compression", value = {
            @Result(id = true, property = "id", column = "id"),
            @Result(property = "compressData", column = "compress_data"),
            @Result(property = "data", column = "data"),
            @Result(property = "createTime", column = "create_time")}
    )
    Compression selectData(Integer id);

}
